using System.Drawing;
using System.Windows.Forms;
using System.Xml;

namespace Send2Sharepoint.Forms
{
    public class InputControlFactoryImplementation:IInputControlFactory
    {
        public InputControl MakeInputControl(XmlNode element)
        {
            var attributeCollection = element.Attributes;
            switch (attributeCollection["Type"].Value)
            {
                case "Boolean":
                    return (new CheckBoxControl(element));
                case "DateTime":
                    return (new DateTimeControl(element));
                case "MultiChoice":
                    return (new MultiChoiceControl(element));
                case "Choice":
                    return (new ChoiceControl(element));
                case "Note":
                    return (new TextAreaControl(element));
                case "Number":
                case "Text":
                default:
                    return (new TextBoxControl(element));
            }
        }
    }
}